<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="85px">
      <el-form-item label="设备序列号" prop="sn">
        <el-input
          v-model="queryParams.sn"
          placeholder="请输入设备序列号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="设备名称" prop="deviceName">
        <el-input
          v-model="queryParams.deviceName"
          placeholder="请输入设备名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="系统标识" prop="sysId">
        <el-input
          v-model="queryParams.sysId"
          placeholder="请输入系统标识"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="设备类型" prop="deviceTypeId">
        <el-select v-model="queryParams.deviceTypeId" placeholder="请选择设备类型" clearable size="small">
          <el-option
            v-for="dict in dict.type.pressure_sensor_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="厂家编码" prop="pkey">
        <el-input
          v-model="queryParams.pkey"
          placeholder="请输入厂家编码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="设备标识码" prop="meid">
        <el-input
          v-model="queryParams.meid"
          placeholder="请输入设备标识码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="软件版本号" prop="sver">
        <el-input
          v-model="queryParams.sver"
          placeholder="请输入软件版本号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="硬件版本号" prop="hver">
        <el-input
          v-model="queryParams.hver"
          placeholder="请输入硬件版本号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="通信方式" prop="connType">
        <el-select v-model="queryParams.connType" placeholder="请选择通信方式" clearable size="small">
          <el-option
            v-for="dict in dict.type.communication_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="供电方式" prop="power">
        <el-select v-model="queryParams.power" placeholder="请选择供电方式" clearable size="small">
          <el-option
            v-for="dict in dict.type.power_supply_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="上报方式" prop="mode">
        <el-select v-model="queryParams.mode" placeholder="请选择上报方式" clearable size="small">
          <el-option
            v-for="dict in dict.type.ps_report_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="设备状态" prop="version">
        <el-select
          v-model="queryParams.clientStat"
          placeholder="设备状态"
          clearable
          size="small"
          style="width: 240px"
        >
          <el-option
            v-for="dict in dict.type.ps_device_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['device:pressureSensorClient:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['device:pressureSensorClient:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="pressureSensorClientList" @sort-change="onSortChange" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column sortable label="ID" align="center" prop="id" />
      <el-table-column sortable label="设备序列号" align="center" prop="sn" />
      <el-table-column sortable label="设备名称" align="center" prop="deviceName" />
      <el-table-column label="系统标识" align="center" prop="sysId" />
      <!--<el-table-column label="设备类型" align="center" prop="deviceTypeId">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.pressure_sensor_type" :value="scope.row.deviceTypeId"/>
        </template>
      </el-table-column>
      <el-table-column label="厂家编码" align="center" prop="pkey" />
      <el-table-column label="设备标识码" align="center" prop="meid" />
      <el-table-column label="软件版本号" align="center" prop="sver" />
      <el-table-column label="硬件版本号" align="center" prop="hver" />
      <el-table-column label="通信方式" align="center" prop="connType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.communication_mode" :value="scope.row.connType"/>
        </template>
      </el-table-column>
      <el-table-column label="信号强度" align="center" prop="signalStrength" />
      <el-table-column label="供电方式" align="center" prop="power">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.power_supply_mode" :value="scope.row.power"/>
        </template>
      </el-table-column>
      <el-table-column label="上报方式" align="center" prop="mode">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ps_report_mode" :value="scope.row.mode"/>
        </template>
      </el-table-column>
      <el-table-column label="上报周期(秒)" align="center" prop="dc" />
      <el-table-column label="设备时间" align="center" prop="ct" />
      <el-table-column label="压力超限报警" align="center" prop="alarm" />
      <el-table-column label="经度" align="center" prop="longitude" />
      <el-table-column label="纬度" align="center" prop="latitude" />-->
      <el-table-column label="所在地址" align="center" prop="address" />
      <el-table-column sortable="custom" label="最后通讯" align="center" prop="updateTime" width="200">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="在线状态" align="center" prop="clientStat">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ps_device_status" :value="scope.row.clientStat"/>
        </template>
      </el-table-column>
      <el-table-column label="归属单位" align="center" prop="deptId" />
      <el-table-column label="管理人id" align="center" prop="userId" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleDetail(scope.row)"
            v-hasPermi="['device:pressureSensorClient:list']"
          >查看</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleSetting(scope.row)"
            v-hasPermi="['device:pressureSensorClient:setting']"
          >配置</el-button>
          <el-dropdown @command="(command) => {
            handleCommand(command, scope.row)
          }">
            <span class="el-dropdown-link">
              更多操作<i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="earthquakeDrill">地震演练</el-dropdown-item>
              <el-dropdown-item command="deviceTest">设备测试</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 查看设备对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
      <el-descriptions :column="2" style="background: #ffffff00; color: #FFFFFF" border>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-info"></i>
            设备序列号
          </template>
          {{ form.sn }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-star-on"></i>
            厂家编码
          </template>
          {{ form.pkey }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            系统标识
          </template>
          {{ form.sysId }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            设备类型
          </template>
          <dict-tag :options="dict.type.pressure_sensor_type" :value="form.deviceTypeId"/>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            厂家编码
          </template>
          {{ form.pkey }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            设备标识码
          </template>
          {{ form.meid }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            软件版本号
          </template>
          {{ form.sver }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            硬件版本号
          </template>
          {{ form.hver }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            通信方式
          </template>
          <dict-tag :options="dict.type.communication_mode" :value="form.connType"/>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            供电方式
          </template>
          <dict-tag :options="dict.type.power_supply_mode" :value="form.power"/>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            上报方式
          </template>
          <dict-tag :options="dict.type.ps_report_mode" :value="form.mode"/>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            上报周期(秒)
          </template>
          {{ form.dc }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            信号强度
          </template>
          {{ form.signalStrength }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            设备时间
          </template>
          {{ form.ct }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            压力超限报警
          </template>
          {{ form.alarm }}
        </el-descriptions-item>
      </el-descriptions>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="cancel">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 配置设备对话框 -->
    <el-dialog title="配置参数" :visible.sync="settingFormOpen" width="50%" append-to-body>
      <el-form ref="settingForm" :model="settingForm" label-width="80px">
        <el-descriptions :column="2" style="background: #ffffff00; color: #FFFFFF" border>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-info"></i>
              设备序列号
            </template>
            {{ settingForm.sn }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-star-on"></i>
              厂家编码
            </template>
            {{ settingForm.pkey }}
          </el-descriptions-item>
        </el-descriptions>
        <el-tabs v-loading="settingDialogLoading" v-model="activeSettingTabName" type="border-card" style="margin-top: 10px;">
          <el-tab-pane label="报警参数" name="first">
            <el-descriptions :column="2" style="background: #ffffff00; color: #FFFFFF; overflow-x: auto" border>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-upload2"></i>
                  高高限阈值
                </template>
                <el-input-number v-model="settingForm.limitAlarmHh" :min="0"></el-input-number> （kPa）
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-top"></i>
                  高限阈值
                </template>
                <el-input-number v-model="settingForm.limitAlarmH" :min="0"></el-input-number> （kPa）
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-bottom"></i>
                  低限阈值
                </template>
                <el-input-number v-model="settingForm.limitAlarmL" :min="0"></el-input-number> （kPa）
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-download"></i>
                  低低限阈值
                </template>
                <el-input-number v-model="settingForm.limitAlarmLl" :min="0"></el-input-number> （kPa）
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-sort-down"></i>
                  量程低值
                </template>
                <el-input-number v-model="settingForm.rangeL" :min="0" :step="5"></el-input-number> （kPa）
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-sort-up"></i>
                  量程高值
                </template>
                <el-input-number v-model="settingForm.rangeH" :min="0" :step="5"></el-input-number> （kPa）
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-refresh"></i>
                  数据上传周期
                </template>
                <el-input-number v-model="settingForm.dc" :min="0" :step="10"></el-input-number> （秒）
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-location"></i>
                  设备位置信息
                </template>
                <el-input placeholder="请输入地址" v-model="settingForm.address">
                  <template slot="append"><i class="el-icon-map-location"></i></template>
                </el-input>
              </el-descriptions-item>
            </el-descriptions>
          </el-tab-pane>
          <el-tab-pane label="设备管理" name="second">
            <el-descriptions :column="2" style="background: #ffffff00; color: #FFFFFF" border>
              <el-descriptions-item>
                <template slot="label">
                  <i :class="settingForm.factoryId ? 'el-icon-unlock' : 'el-icon-lock'"></i>
                  设备厂内安装身份ID
                </template>
                <el-input placeholder="请输入设备厂内安装身份ID" v-model="settingForm.factoryId"></el-input>
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-timer"></i>
                  低压报警
                </template>
                <el-switch v-model="settingForm.lowAlarm" active-text="开启" inactive-text="关闭"></el-switch>
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i :class="settingForm.solenoidValveOnOff ? 'el-icon-unlock' : 'el-icon-lock'"></i>
                  电磁阀通断控制
                </template>
                <el-switch v-model="settingForm.solenoidValveOnOff" active-text="开启" inactive-text="关闭"></el-switch>
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-timer"></i>
                  设备校时
                </template>
                <el-link type="primary" @click="ntpHandler">校时<i class="el-icon-refresh el-icon--right"></i> </el-link>
              </el-descriptions-item>
            </el-descriptions>
          </el-tab-pane>
        </el-tabs>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="settingFormSetting" type="primary" @click="submitSettingForm">确 定</el-button>
        <el-button @click="settingFormOpen = false">取 消</el-button>
      </div>
    </el-dialog>



    <!-- 发布地震演练对话框 -->
    <el-dialog title="地震预警演练" :visible.sync="earthquakeDrillFormOpen" width="500px" append-to-body>
      <el-form ref="settingForm" :model="earthquakeDrillForm" label-width="80px">
        <el-form-item label="倒计时(秒)" prop="second">
          <el-input-number v-model='earthquakeDrillForm.second' :min="0" :max="999" style="width: 100%"/>
        </el-form-item>
        <el-form-item label="地震烈度" prop="userId">
          <el-input-number v-model='earthquakeDrillForm.intensity' :min="0" :max="20" style="width: 100%" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="earthquakeDrillSetting" type="primary" @click="publishEarthquakeDrill">发 布</el-button>
        <el-button @click="earthquakeDrillFormOpen = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listPressureSensorClient, getPressureSensorClient, delPressureSensorClient, addPressureSensorClient, updatePressureSensorClient, settingParams, getPressureSensorParamBySn } from "@/api/device/pressureSensorClient";

export default {
  name: "PressureSensorClient",
  dicts: ['power_supply_mode', 'communication_mode', 'pressure_sensor_type', 'ps_report_mode', 'ps_device_status'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 设备表格数据
      pressureSensorClientList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        sn: null,
        deviceName: null,
        sysId: null,
        deviceTypeId: null,
        pkey: null,
        meid: null,
        sver: null,
        hver: null,
        connType: null,
        power: null,
        mode: null,
        dc: null,
        ct: null,
        alarm: null,
        longitude: null,
        latitude: null,
        address: null,
        deptId: null,
        userId: null,
        clientStat: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        sn: [
          { required: true, message: "设备序列号不能为空", trigger: "blur" }
        ],
        deviceName: [
          { required: true, message: "设备名称不能为空", trigger: "blur" }
        ],
        sysId: [
          { required: true, message: "系统标识不能为空", trigger: "blur" }
        ],
        deviceTypeId: [
          { required: true, message: "设备类型不能为空", trigger: "change" }
        ],
        pkey: [
          { required: true, message: "厂家编码不能为空", trigger: "blur" }
        ],
        meid: [
          { required: true, message: "设备标识码不能为空", trigger: "blur" }
        ],
      },
      activeSettingTabName: 'first',
      settingFormOpen: false,
      settingFormSetting: false,
      settingDialogLoading: false,
      settingForm: {
        limitAlarmHh: 100,
        limitAlarmH: 90,
        limitAlarmL: 10,
        limitAlarmLl: 5,
        rangeL: 0,
        rangeH: 2500,
        dc: 10,
        ntpOrNot: 0,
        address: '-',
        solenoidValveOnOff: true,
        pkey: null,
        sn: null,
        factoryId: null,
        lowAlarm: false
      },
      earthquakeDrillFormOpen: false,
      earthquakeDrillSetting: false,
      earthquakeDrillForm: {
        second: 0,
        intensity: 0
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询设备列表 */
    getList() {
      this.loading = true;
      listPressureSensorClient(this.queryParams).then(response => {
        this.pressureSensorClientList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    onSortChange(column, prop, order) {
      this.queryParams.orderByColumn = column.prop;
      this.queryParams.isAsc = column.order;
      this.getList();
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        sn: null,
        deviceName: null,
        sysId: null,
        deviceTypeId: null,
        pkey: null,
        meid: null,
        sver: null,
        hver: null,
        connType: null,
        power: null,
        mode: null,
        dc: null,
        ct: null,
        alarm: null,
        longitude: null,
        latitude: null,
        address: null,
        deptId: null,
        userId: null,
        createTime: null,
        createBy: null,
        updateTime: null,
        updateBy: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加设备";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getPressureSensorClient(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改设备";
      });
    },
    /** 查看按钮操作 */
    handleDetail(row) {
      this.reset();
      const id = row.id || this.ids
      getPressureSensorClient(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "查看设备信息";
      });
    },
    handleSetting(row) {
      let _this = this;
      _this.settingFormOpen = true;
      _this.settingDialogLoading = true;
      _this.settingFormSetting = false;
      getPressureSensorParamBySn(row.sn).then(res => {
        _this.settingForm = {
          limitAlarmHh: res.data.limitAlarmHh,
          limitAlarmH: res.data.limitAlarmH,
          limitAlarmLl: res.data.limitAlarmLl,
          limitAlarmL: res.data.limitAlarmL,
          rangeL: res.data.rangeL,
          rangeH: res.data.rangeH,
          solenoidValveOnOff: res.data.solenoidValveOnOff,
          dc: row.dc,
          pkey: row.pkey,
          sn: row.sn,
          factoryId: row.factoryId,
          lowAlarm: row.lowAlarm
        }
        _this.settingFormOpen = true;
        _this.settingDialogLoading = false;
      })
    },
    submitSettingForm(){
      this.settingForm.ntpOrNot = 0;
      this.settingFormSetting = true;
      settingParams(this.settingForm).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.settingFormOpen = false;
        this.settingFormSetting = false;
      });
    },
    ntpHandler(){
      this.settingForm.ntpOrNot = 1;
      _this.settingDialogLoading = true;
      settingParams(this.settingForm).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.settingFormOpen = false;
        _this.settingDialogLoading = false;
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updatePressureSensorClient(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPressureSensorClient(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除数据编号为"' + ids + '"的数据项？').then(function() {
        return delPressureSensorClient(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('device/pressureSensorClient/export', {
        ...this.queryParams
      }, `pressureSensorClient_${new Date().getTime()}.xlsx`)
    },
    /** 下拉菜单操作 **/
    handleCommand(command, row) {
      console.log(command, row)
      if(command == 'earthquakeDrill'){
        this.earthquakeDrillForm = {
          second: 0,
          intensity: 0,
          sn: row.sn
        }
        this.earthquakeDrillFormOpen = true;
      }
    },
    publishEarthquakeDrill() {
      let sn = this.earthquakeDrillForm.sn;
      this.earthquakeDrillSetting = true;
      pressureSensorEarthquakeDrill(sn).then(response => {
        this.$modal.msgSuccess("发布成功");
        this.earthquakeDrillSetting = false;
        this.earthquakeDrillFormOpen = true;
      });
    }
  }
};
</script>
